API Documentation
TreeReader.h
1 // TreeReader.h
3 //
5 
6 namespace nkExport
7 {
33  class TreeReader final
34  {
35  public :
36 
37  // Constructor, destructor
45  TreeReader (const TreeReader&) = delete ;
51  TreeReader (TreeReader&& other) ;
56 
57  // Controls
66  void addBool (bool& target, nkMemory::StringView path) ;
75  void addInt (int& target, nkMemory::StringView path) ;
84  void addUint (unsigned int& target, nkMemory::StringView path) ;
93  void addFloat (float& target, nkMemory::StringView path) ;
103 
115  template <typename T>
116  void addVector (nkMemory::BufferCast<T>& target, std::function<T (nkExport::Node*)> entryFiller, nkMemory::StringView path)
117  {
118  _entries.append(new TreeReaderCompositeEntry<T>(target, entryFiller, path)) ;
119  }
120 
121  // Filling
127  void fill (nkExport::Node* tree) ;
128 
129  // Operators
133  TreeReader& operator= (const TreeReader&) = delete ;
140  } ;
141 }
nkExport::TreeReader::addInt
void addInt(int &target, nkMemory::StringView path)
nkExport::TreeReader::~TreeReader
~TreeReader()
nkExport::TreeReader::addBool
void addBool(bool &target, nkMemory::StringView path)
nkExport::TreeReader::addUint
void addUint(unsigned int &target, nkMemory::StringView path)
nkExport
Encompasses all API of component NilkinsExport.
Definition: Base64Encoder.h:7
nkExport::TreeReader::TreeReader
TreeReader()
nkExport::TreeReader::addString
void addString(nkMemory::String &target, nkMemory::StringView path)
nkExport::TreeReader::addFloat
void addFloat(float &target, nkMemory::StringView path)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkExport::TreeReader
Utility class providing an easier way to parse trees.
Definition: TreeReader.h:34
nkExport::TreeReader::operator=
TreeReader & operator=(const TreeReader &)=delete
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkExport::TreeReader::addVector
void addVector(nkMemory::BufferCast< T > &target, std::function< T(nkExport::Node *)> entryFiller, nkMemory::StringView path)
Definition: TreeReader.h:116
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMemory::BufferCast
Holds a Buffer and make it easy to cast the binary data.
Definition: BufferCast.h:18
nkExport::TreeReader::fill
void fill(nkExport::Node *tree)
nkExport::TreeReader::TreeReader
TreeReader(TreeReader &&other)
nkExport::TreeReader::TreeReader
TreeReader(const TreeReader &)=delete